// 楼宇信息
import qs from 'qs'
import request from '@/utils/request'
// 配置公共的header
const headers = {
  'Content-Type': 'application/json;charset=utf-8'
}

/**
 * @name addDictionary
 * @description 添加字典
 * @author wqy
 * @date 2020-09-03 15:29:07
 */
export function addDictionary(data) {
  return request({
    url: '/web/sysDict/add',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name getSysDictByDictCode
 * @description 根据code查重
 * @author wqy
 * @date 2020-09-04 09:41:45
*/
export function getSysDictByDictCode(data) {
  return request({
    url: '/web/sysDict/getSysDictByDictCode',
    method: 'get',
    params: data
  })
}

/**
 * @name deleteDictionary
 * @description 删除字典
 * @author wqy
 * @date 2020-09-03 15:29:14
*/
export function deleteDictionary(data) {
  return request({
    url: '/web/sysDict/delete',
    method: 'get',
    params: data
  })
}

/**
 * @name editDictionary
 * @description 字典编辑
 * @author wqy
 * @date 2020-09-03 15:30:21
*/
export function editDictionary(data) {
  return request({
    url: '/web/sysDict/edit',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name listDictionary
 * @description 字典列表
 * @author wqy
 * @date 2020-09-03 15:30:21
*/
export function listDictionary(data) {
  return request({
    url: '/web/sysDict/queryPageList',
    method: 'post',
    data: data,
    ...headers
  })
}

/**
 * @name getSysDictItemList
 * @description 获取列表
 * @author wqy
 * @date 2020-09-03 16:44:25
*/
export function getSysDictItemList(data) {
  return request({
    url: '/web/sysDictItem/getSysDictItemList',
    method: 'post',
    data: data,
    ...headers
  })
}

/**
 * @name deleteForm
 * @description 删除抽屉字典
 * @author wqy
 * @date 2020-09-03 15:29:14
*/
export function deleteForm(data) {
  return request({
    url: '/web/sysDictItem/delete',
    method: 'get',
    params: data
  })
}
/**
 * @name formAdd
 * @description 抽屉  字典新增
 * @author wqy
 * @date 2020-09-03 15:30:21
*/
export function formAdd(data) {
  return request({
    url: '/web/sysDictItem/add',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name formEdit
 * @description 抽屉 字典编辑
 * @author wqy
 * @date 2020-09-03 15:30:21
*/
export function formEdit(data) {
  return request({
    url: '/web/sysDictItem/edit',
    method: 'post',
    data: data,
    ...headers
  })
}
/**
 * @name getSysDictByDictCode
 * @description 判断同一个字典id是否有重复
 * @author wqy
 * @date 2020-09-04 09:41:45
*/
export function getSysDictItemByCon(data) {
  return request({
    url: '/web/sysDictItem/getSysDictItemByCon',
    method: 'post',
    data: data,
    ...headers
  })
}